﻿namespace ElencySolutions.MultipleProperty.Configuration
{
    using System.Configuration;

    /// <summary>
    /// Multiple property configuration class
    /// </summary>
    public class MultiplePropertyConfiguration : ConfigurationSection
    {
        public static MultiplePropertyConfiguration GetConfiguration()
        {
            MultiplePropertyConfiguration configuration = ConfigurationManager.GetSection("elencysolutions.multipleproperty") as MultiplePropertyConfiguration;
            return configuration ?? new MultiplePropertyConfiguration();
        }

        /// <summary>
        /// Gets a value indicating whether [copy as new default].
        /// </summary>
        /// <value>
        ///   <c>true</c> if [copy as new default]; otherwise, <c>false</c>.
        /// </value>
        [ConfigurationProperty("copyAsNewDefault", IsRequired = false, DefaultValue = false)]
        public virtual bool CopyAsNewDefault
        {
            get { return (bool)this["copyAsNewDefault"]; }
        }

        /// <summary>
        /// Gets a value indicating whether [allow property copying default].
        /// </summary>
        /// <value>
        /// 	<c>true</c> if [allow property copying default]; otherwise, <c>false</c>.
        /// </value>
        [ConfigurationProperty("allowPropertyCopyingDefault", IsRequired = false, DefaultValue = false)]
        public virtual bool AllowPropertyCopyingDefault
        {
            get { return (bool)this["allowPropertyCopyingDefault"]; }
        }

        /// <summary>
        /// Gets a value indicating whether [show asterix for required fields].
        /// </summary>
        /// <value>
        /// 	<c>true</c> if [show asterix for required fields]; otherwise, <c>false</c>.
        /// </value>
        [ConfigurationProperty("showAsterixForRequiredFields", IsRequired = false, DefaultValue = true)]
        public virtual bool ShowAsterixForRequiredFields
        {
            get { return (bool)this["showAsterixForRequiredFields"]; }
        }

        /// <summary>
        /// Gets the XML namespace.
        /// </summary>
        [ConfigurationProperty("xmlns", IsRequired = false)]
        public string XmlNamespace
        {
            get { return "http://ElencySolutions.MultipleProperty.Configuration.MulitplePropertyConfiguration"; }
        }
    }
}
